#include <lua.hpp>

#include "device.h"
#include "hEngine.h"

int main() {

	P.L = luaL_newstate();
   	luaL_openlibs(P.L);

   	initEngineFuncs();

   	if(luaL_dofile(P.L,"script.lua")) {
      const char* err = lua_tostring(P.L, -1);
      printf("%s\n", err);
   	}

	if (P.Device)
		P.Device->drop();

	if (P.SoundEngine)
		P.SoundEngine->drop();

	return 0;
}
